home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
A-COMAL Series
/
(k)aad.d64
/
promal-ahls.s
< prev
next >
Wrap
Text File
|
2007-02-28
|
505b
|
38 lines
program ahls
;
include library
include realfuncs
word n
word i
word prtr
real a
real r
real s
real acc
real ran
;
begin
put " Running........",cr
r=0
s=0
prtr=open("p",'w')
for n=1 to 100
a=n
for i=1 to 10
a=sqrt(a)
r=r+random/65535.
for i=1 to 10
a=power(a,2.0)
r=r+random/65535.
s=s+a
put " Finished!",cr
acc=abs(1010.-s/5)
ran=abs(1000.-r)
output "#cAccuracy=#10e",acc
output "#cRandom =#10e",ran
outputf prtr,"#cAccuracy=#10e#c",acc
outputf prtr,"#cRandom =#10e#c",ran
end